// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// BBCode tags example
// http://en.wikipedia.org/wiki/Bbcode
// ----------------------------------------------------------------------------
// Feel free to add more tags
// ----------------------------------------------------------------------------
mySettings = {
	previewParserPath:	'', // path to your BBCode parser
	markupSet: [
		{name:'Жирный', className:'button_bold', openWith:'[b]', closeWith:'[/b]'},
		{name:'Прописной', className:'button_italic', openWith:'[i]', closeWith:'[/i]'},
		{name:'Подчеркнутый', className:'button_underline', openWith:'[u]', closeWith:'[/u]'},
		{separator:'---------------' },
		{name:'Картинка', className:'button_image', replaceWith:'[img][![Url]!][/img]'},
		{name:'Ссылка', className:'button_clean', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
//		{separator:'---------------' },
//		{name:'Размер', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]',
//		dropMenu :[
//			{name:'Большой', openWith:'[size=200]', closeWith:'[/size]' },
//			{name:'Нормальный', openWith:'[size=100]', closeWith:'[/size]' },
//			{name:'Маленький', openWith:'[size=50]', closeWith:'[/size]' }
//		]},
//		{separator:'---------------' },
//		{name:'Список (тчк.)', openWith:'[list]\n', closeWith:'\n[/list]'},
//		{name:'Список (цифр.)', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'},
//		{name:'Элемент списка', openWith:'[*] '},
//		{separator:'---------------' },
//		{name:'Цитата', openWith:'[quote]', closeWith:'[/quote]'},
//		{name:'Код', openWith:'[code]', closeWith:'[/code]'},
//		{separator:'---------------' },
        {name:'Менеджер изображений', className:'button_images', call:'imagesManager.show()'},
        {name:'Кат', className: 'button_cut', openWith:'<!-- pagebreak -->', closeWith:''},
        {name:'Видео', className:'button_video', key:'', replaceWith:'[video=[![Url]!]]'},
        {name:'Флеш', className:'button_flash', key:'', replaceWith:'[flash=425,264][![Url]!][/flash]'},
        {name:'Цвет', className:'button_color', openWith:'[color=[![Color]!]]', closeWith:'[/color]', 
		dropMenu: [
          {name:'Yellow', openWith:'[color=yellow]', closeWith:'[/color]', className:"col1-1" },
          {name:'Orange', openWith:'[color=orange]', closeWith:'[/color]', className:"col1-2" },
          {name:'Red', openWith:'[color=red]', closeWith:'[/color]', className:"col1-3" },
          {name:'Blue', openWith:'[color=blue]', closeWith:'[/color]', className:"col2-1" },
          {name:'Purple', openWith:'[color=purple]', closeWith:'[/color]', className:"col2-2" },
          {name:'Green', openWith:'[color=green]', closeWith:'[/color]', className:"col2-3" },
          {name:'White', openWith:'[color=white]', closeWith:'[/color]', className:"col3-1" },
          {name:'Gray', openWith:'[color=gray]', closeWith:'[/color]', className:"col3-2" },
          {name:'Black', openWith:'[color=black]', closeWith:'[/color]', className:"col3-3" }
      ]},

        {separator:'---------------' },
        {name:'Очистить', className:"button_clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } },
        {name:'Предпросмотр', className:"button_preview", call:'recordPreview' },
        {name:'Перевести', className:"button_italic", replaceWith:function(markitup){ 
        	yaTranslate(markitup.selection, 'en', 'ru', function(tr){
        		$.markItUp({ replaceWith: "/"+markitup.selection+"/ "+tr });
        	});
        	return markitup.selection;
        }}
	]
}
